fixing bugs, more spec compliance tweaks