Various fixes, too lazy to write full changes