Fixed many minor problems from the original project