Fix getting socket options and a warning