Tested and fixed major bugs