Fixes to various things. Confirmed working.