Bug fix: input handling