Fixed some docs examples and improved code readability