Fixed some bugs, polished some codes

Signed-off-by: Jefferson Cordero <jepjephooray05@gmail.com>