Several small fixes

Some small fixes