Fixed #27 and improved #25.