Avoid undefined errors

Signed-off-by: Suki <suki@missallsunday.com>
Yet more fixes

Signed-off-by: Suki <suki@missallsunday.com>