fix warnings: check for nulls, add bin dir