Fixed crash

- Fixed crash from last commit
- polished stuff
- Added the proper default values based on resolution