Fixed some issues that I fixed before but broke again due to a wrong merge.. FML