[BUGFIX] Make argument layout act as documented

According to the docs the argument 'layout' expects 'flag', 'name', 'flag,name' or 'name,flag' as values but the relevant code checked for values 0,1 or 2.