Fixed some formatting and bugs