Modified errors returned from procedures

Changed the returns from the procedures to return long types indicating
failure as opposed to throwing exceptions.