Fixed camera matrix calculations and tidied code.