All around bug fixes.