Various fixes/improvements, taking into accoutn wkeese's feedback