Sanity checking + tweaks here and there.