Basic tests and fixes for #16