cleaned up code, gem spec fixes