Finished code review, fixed bugs