fix undefined value (fixes #402)