Some minor fixes for ubuntu12