Some all around bug fixes.