Added error handling to sysctls.