Implemented proper error handling for PLY. Still need error handling for lib D object. Starting the work on #2