various fixes - thx to Cristian :)