Fixes #623 Signed-off-by: Andreas Schneider <asn@cryptomilk.org> (cherry picked from commit f8f63a8b4033549d47384c6e2b1972ae1a2775fc)