Applied preference changes to v22 and fixed an implementation bug

simple enough swap between two lines fix for the bug, doesn't really need to be merged I don't think.