Made many small fixes