bugs fixing and consistency