fix #18.
better error messages.
expose less functions.