Some fixes

This should close some issues.