Various API cleanups

Should fix #5