Bugfix: stdin.expect in loop; style fixes