Fix build target checking