Initial commit fixing small bugs