[z1846] Cleanup spline flag code.

Actually this is a partly backported commit.
Also fixes one compile warning due to earlier backport typo.

(based on commit cf3f090)
(based on commit 43d2bf8)

(cleaned version of c1a30d9)

(based on commit [s1407] - 8c46a2d)