First commit to derek-dev branch

Fix #23 #27 and #54