Fixes#24. Manually merge with fixes maked by @qnective
Fixes#24. Manually merge with fixes maked by @qnective