Added error checking

You know, for those copy-paste types.