Merge Shabai's changes

Merge changes + a few tweaks