Fix for issue 29 and 30

https://github.com/tparikh/pw2mw/issues/30

https://github.com/tparikh/pw2mw/issues/29