Solved minor problems and bugs