Added some more bug checking