Merged and fixed bugs