Fix password flags handling [issues #314 & #315]