BUG: Fixes from svn head