Bug fixes & code readability