Updated and fixed bugs