Merge pull request #135 from SupunS/master

Modified exporting/hiding packages
error handling is added
fixed some issues
add more error checking