UB kludges

This should make broken scripts happier.

Signed-off-by: katlogic <kat@lua.cz>