Minor fixes, basic tests seem to be working