viewport bug fixes