Cleaned from some bugs