Added several small fixes