Uncommenting error check, removing dead code