Better viewport handling