Improved fixes for #3

Added better exception