strip whitespace + some small fixes