Added error checking

MAL was down so I figure it was a good opportunity to make tests.