Fixed collision with borders
Merged changes