Fixed bucketName function; added test