Fixes and expanded tests