Fix minor bugs and add some funcional