Add checks for select and stdio usage

Also: redundant return statements at the bottom of void functions.