Added some empty checks, Fixes #13