bugfixes with rectangle collision