Fix #35 wrong amount calculation