BUG: avoid seg fault due to parameter inputs. style adjusted.