Resolved several small bugs

Resolved several small bugs