Fix for window resize

- Fixed issues related window resize
- Trim trailing whitespaces