 
 exports.client_deleteBeacon = (client, location) ->	
 	#Finding the right beacon
-	if Db.shared.get('gameState') isnt 0
+	if Db.shared.peek('gameState') isnt 0
 		log Plugin.userName(client), ' (id=', client, ') tried to delete a beacon while game is not in setup phase!'
 	else
 		Db.shared.iterate 'game', 'beacons', (beacon) !->
-			if beacon.get('location', 'lat') == location.lat and beacon.get('location', 'lng') == location.lng
+			if beacon.peek('location', 'lat') == location.lat and beacon.peek('location', 'lng') == location.lng
 				log 'Deleted beacon: key='+beacon.key()+', lat=', location.lat, ', lng=', location.lng
 				Db.shared.remove 'game', 'beacons', beacon.key()
 	

	# Handle points and statistics
	client = args.players.split(', ')[0]
	log "[onCapture()] " + client
	beaconValue = beacon.get('captureValue')
	modifyScore client, beaconValue
	for player in args.players.split(', ')
		Db.shared.modify 'game', 'teams', getTeamOfUser(player), 'users', player, 'captured', (v) -> v+1


# Checkin location for capturing a beacon		
exports.client_checkinLocation = (client, location) ->
	if Db.shared.peek 'gameState' is not 1
		log 'Client ', client, ' (', Plugin.userName(client), ') tried to capture beacon while game is not running!'
	else
		log 'checkinLocation() client: ', client, ', location: lat=', location.lat, ', lng=', location.lng
