Fixed more tests
Merge origin/master
Fixed more tests
Restructured apply methods