Fix tests.
Fix formatting and comment why fcntl.h is included.