minor tweaks.
better error msgs.
Fixed issue #52.