config: fix typos
test: fix warning on close()
math: use math functions where possible