Fixes Bugs on the implementation