Added options to replace method - fixes #34