bugfix and typo (reverted from commit 54738105231256275d9a4d1fa2e2c2322f94cb31)