Fixed a set of issues