Fixed label issues. Added error checks.