Added option to enable navigation contraits for folding, unfolding or both + various fixes and cleanup