Fixed a bug and one issue